using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using Spacejock;
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
using yW5Lib;
using yWriter6.My.Resources;

namespace yWriter6
{
	[DesignerGenerated]
	internal class frmSceneList : Form
	{
		public delegate void ClosedFormEventHandler();

		public delegate void MovedScenesEventHandler();

		public delegate void EditSceneEventHandler(int ScID, int WhichTab);

		private IContainer components;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdChangeSelected")]
		private Button _cmdChangeSelected;

		[CompilerGenerated]
		[AccessedThroughProperty("cmbStatus")]
		private ComboBox _cmbStatus;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdExit")]
		private Button _cmdExit;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr1")]
		private ColumnHeader _lvwColHdr1;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr2")]
		private ColumnHeader _lvwColHdr2;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr3")]
		private ColumnHeader _lvwColHdr3;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr4")]
		private ColumnHeader _lvwColHdr4;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr5")]
		private ColumnHeader _lvwColHdr5;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr6")]
		private ColumnHeader _lvwColHdr6;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr7")]
		private ColumnHeader _lvwColHdr7;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr8")]
		private ColumnHeader _lvwColHdr8;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr9")]
		private ColumnHeader _lvwColHdr9;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr10")]
		private ColumnHeader _lvwColHdr10;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr11")]
		private ColumnHeader _lvwColHdr11;

		[CompilerGenerated]
		[AccessedThroughProperty("lvwColHdr12")]
		private ColumnHeader _lvwColHdr12;

		[CompilerGenerated]
		[AccessedThroughProperty("ListScenes")]
		private ListView _ListScenes;

		public ToolTip ToolTip1;

		[CompilerGenerated]
		[AccessedThroughProperty("Timer1")]
		private System.Windows.Forms.Timer _Timer1;

		[CompilerGenerated]
		[AccessedThroughProperty("clmFilename")]
		private ColumnHeader _clmFilename;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdPrint")]
		private Button _cmdPrint;

		[CompilerGenerated]
		[AccessedThroughProperty("StatusStrip1")]
		private StatusStrip _StatusStrip1;

		[CompilerGenerated]
		[AccessedThroughProperty("tssStatus")]
		private ToolStripStatusLabel _tssStatus;

		[CompilerGenerated]
		private ClosedFormEventHandler ClosedFormEvent;

		[CompilerGenerated]
		private MovedScenesEventHandler MovedScenesEvent;

		[CompilerGenerated]
		private EditSceneEventHandler EditSceneEvent;

		private clsProject cProject;

		private const string nameStatus = "STATUS";

		private const string nameVPTitle = "VPTITLE";

		private bool DraggingScenes;

		private Rectangle HighlightedScene;

		public virtual Button cmdChangeSelected
		{
			[CompilerGenerated]
			get
			{
				return _cmdChangeSelected;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdChangeSelected_Click;
				Button cmdChangeSelected = _cmdChangeSelected;
				if (cmdChangeSelected != null)
				{
					cmdChangeSelected.Click -= value2;
				}
				_cmdChangeSelected = value;
				cmdChangeSelected = _cmdChangeSelected;
				if (cmdChangeSelected != null)
				{
					cmdChangeSelected.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("cmbStatus")]
		public virtual ComboBox cmbStatus
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual Button cmdExit
		{
			[CompilerGenerated]
			get
			{
				return _cmdExit;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdExit_Click;
				Button cmdExit = _cmdExit;
				if (cmdExit != null)
				{
					cmdExit.Click -= value2;
				}
				_cmdExit = value;
				cmdExit = _cmdExit;
				if (cmdExit != null)
				{
					cmdExit.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("lvwColHdr1")]
		public virtual ColumnHeader lvwColHdr1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr2")]
		public virtual ColumnHeader lvwColHdr2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr3")]
		public virtual ColumnHeader lvwColHdr3
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr4")]
		public virtual ColumnHeader lvwColHdr4
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr5")]
		public virtual ColumnHeader lvwColHdr5
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr6")]
		public virtual ColumnHeader lvwColHdr6
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr7")]
		public virtual ColumnHeader lvwColHdr7
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr8")]
		public virtual ColumnHeader lvwColHdr8
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr9")]
		public virtual ColumnHeader lvwColHdr9
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr10")]
		public virtual ColumnHeader lvwColHdr10
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr11")]
		public virtual ColumnHeader lvwColHdr11
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lvwColHdr12")]
		public virtual ColumnHeader lvwColHdr12
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual ListView ListScenes
		{
			[CompilerGenerated]
			get
			{
				return _ListScenes;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = ListView1_DoubleClick;
				DragEventHandler value3 = ListScenes_DragDrop;
				EventHandler value4 = ListScenes_DragLeave;
				DragEventHandler value5 = ListScenes_DragOver;
				ItemDragEventHandler value6 = ListScenes_ItemDrag;
				EventHandler value7 = ListScenes_SelectedIndexChanged;
				ListView listScenes = _ListScenes;
				if (listScenes != null)
				{
					listScenes.DoubleClick -= value2;
					listScenes.DragDrop -= value3;
					listScenes.DragLeave -= value4;
					listScenes.DragOver -= value5;
					listScenes.ItemDrag -= value6;
					listScenes.SelectedIndexChanged -= value7;
				}
				_ListScenes = value;
				listScenes = _ListScenes;
				if (listScenes != null)
				{
					listScenes.DoubleClick += value2;
					listScenes.DragDrop += value3;
					listScenes.DragLeave += value4;
					listScenes.DragOver += value5;
					listScenes.ItemDrag += value6;
					listScenes.SelectedIndexChanged += value7;
				}
			}
		}

		[field: AccessedThroughProperty("Timer1")]
		internal virtual System.Windows.Forms.Timer Timer1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("clmFilename")]
		internal virtual ColumnHeader clmFilename
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual Button cmdPrint
		{
			[CompilerGenerated]
			get
			{
				return _cmdPrint;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdPrint_Click;
				Button cmdPrint = _cmdPrint;
				if (cmdPrint != null)
				{
					cmdPrint.Click -= value2;
				}
				_cmdPrint = value;
				cmdPrint = _cmdPrint;
				if (cmdPrint != null)
				{
					cmdPrint.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("StatusStrip1")]
		internal virtual StatusStrip StatusStrip1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssStatus")]
		internal virtual ToolStripStatusLabel tssStatus
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public event ClosedFormEventHandler ClosedForm
		{
			[CompilerGenerated]
			add
			{
				ClosedFormEventHandler closedFormEventHandler = ClosedFormEvent;
				ClosedFormEventHandler closedFormEventHandler2;
				do
				{
					closedFormEventHandler2 = closedFormEventHandler;
					ClosedFormEventHandler value2 = (ClosedFormEventHandler)Delegate.Combine(closedFormEventHandler2, value);
					closedFormEventHandler = Interlocked.CompareExchange(ref ClosedFormEvent, value2, closedFormEventHandler2);
				}
				while ((object)closedFormEventHandler != closedFormEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				ClosedFormEventHandler closedFormEventHandler = ClosedFormEvent;
				ClosedFormEventHandler closedFormEventHandler2;
				do
				{
					closedFormEventHandler2 = closedFormEventHandler;
					ClosedFormEventHandler value2 = (ClosedFormEventHandler)Delegate.Remove(closedFormEventHandler2, value);
					closedFormEventHandler = Interlocked.CompareExchange(ref ClosedFormEvent, value2, closedFormEventHandler2);
				}
				while ((object)closedFormEventHandler != closedFormEventHandler2);
			}
		}

		public event MovedScenesEventHandler MovedScenes
		{
			[CompilerGenerated]
			add
			{
				MovedScenesEventHandler movedScenesEventHandler = MovedScenesEvent;
				MovedScenesEventHandler movedScenesEventHandler2;
				do
				{
					movedScenesEventHandler2 = movedScenesEventHandler;
					MovedScenesEventHandler value2 = (MovedScenesEventHandler)Delegate.Combine(movedScenesEventHandler2, value);
					movedScenesEventHandler = Interlocked.CompareExchange(ref MovedScenesEvent, value2, movedScenesEventHandler2);
				}
				while ((object)movedScenesEventHandler != movedScenesEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				MovedScenesEventHandler movedScenesEventHandler = MovedScenesEvent;
				MovedScenesEventHandler movedScenesEventHandler2;
				do
				{
					movedScenesEventHandler2 = movedScenesEventHandler;
					MovedScenesEventHandler value2 = (MovedScenesEventHandler)Delegate.Remove(movedScenesEventHandler2, value);
					movedScenesEventHandler = Interlocked.CompareExchange(ref MovedScenesEvent, value2, movedScenesEventHandler2);
				}
				while ((object)movedScenesEventHandler != movedScenesEventHandler2);
			}
		}

		public event EditSceneEventHandler EditScene
		{
			[CompilerGenerated]
			add
			{
				EditSceneEventHandler editSceneEventHandler = EditSceneEvent;
				EditSceneEventHandler editSceneEventHandler2;
				do
				{
					editSceneEventHandler2 = editSceneEventHandler;
					EditSceneEventHandler value2 = (EditSceneEventHandler)Delegate.Combine(editSceneEventHandler2, value);
					editSceneEventHandler = Interlocked.CompareExchange(ref EditSceneEvent, value2, editSceneEventHandler2);
				}
				while ((object)editSceneEventHandler != editSceneEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				EditSceneEventHandler editSceneEventHandler = EditSceneEvent;
				EditSceneEventHandler editSceneEventHandler2;
				do
				{
					editSceneEventHandler2 = editSceneEventHandler;
					EditSceneEventHandler value2 = (EditSceneEventHandler)Delegate.Remove(editSceneEventHandler2, value);
					editSceneEventHandler = Interlocked.CompareExchange(ref EditSceneEvent, value2, editSceneEventHandler2);
				}
				while ((object)editSceneEventHandler != editSceneEventHandler2);
			}
		}

		[DebuggerNonUserCode]
		protected override void Dispose(bool Disposing)
		{
			if (Disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(Disposing);
		}

		[System.Diagnostics.DebuggerStepThrough]
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(yWriter6.frmSceneList));
			ToolTip1 = new System.Windows.Forms.ToolTip(components);
			cmdChangeSelected = new System.Windows.Forms.Button();
			cmbStatus = new System.Windows.Forms.ComboBox();
			cmdExit = new System.Windows.Forms.Button();
			ListScenes = new System.Windows.Forms.ListView();
			lvwColHdr1 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr2 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr3 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr4 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr5 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr6 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr7 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr8 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr9 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr10 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr11 = new System.Windows.Forms.ColumnHeader();
			lvwColHdr12 = new System.Windows.Forms.ColumnHeader();
			clmFilename = new System.Windows.Forms.ColumnHeader();
			Timer1 = new System.Windows.Forms.Timer(components);
			cmdPrint = new System.Windows.Forms.Button();
			StatusStrip1 = new System.Windows.Forms.StatusStrip();
			tssStatus = new System.Windows.Forms.ToolStripStatusLabel();
			StatusStrip1.SuspendLayout();
			SuspendLayout();
			cmdChangeSelected.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
			cmdChangeSelected.BackColor = System.Drawing.SystemColors.Control;
			cmdChangeSelected.Cursor = System.Windows.Forms.Cursors.Default;
			cmdChangeSelected.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdChangeSelected.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdChangeSelected.Location = new System.Drawing.Point(14, 575);
			cmdChangeSelected.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdChangeSelected.Name = "cmdChangeSelected";
			cmdChangeSelected.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdChangeSelected.Size = new System.Drawing.Size(173, 54);
			cmdChangeSelected.TabIndex = 3;
			cmdChangeSelected.Text = "Change selected to:";
			ToolTip1.SetToolTip(cmdChangeSelected, "Changes the status of the selected scenes");
			cmdChangeSelected.UseVisualStyleBackColor = true;
			cmbStatus.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
			cmbStatus.BackColor = System.Drawing.SystemColors.Window;
			cmbStatus.Cursor = System.Windows.Forms.Cursors.Default;
			cmbStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbStatus.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmbStatus.ForeColor = System.Drawing.SystemColors.WindowText;
			cmbStatus.Location = new System.Drawing.Point(194, 585);
			cmbStatus.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmbStatus.Name = "cmbStatus";
			cmbStatus.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmbStatus.Size = new System.Drawing.Size(152, 25);
			cmbStatus.TabIndex = 2;
			cmdExit.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			cmdExit.BackColor = System.Drawing.SystemColors.Control;
			cmdExit.Cursor = System.Windows.Forms.Cursors.Default;
			cmdExit.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdExit.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdExit.Location = new System.Drawing.Point(764, 575);
			cmdExit.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdExit.Name = "cmdExit";
			cmdExit.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdExit.Size = new System.Drawing.Size(75, 54);
			cmdExit.TabIndex = 1;
			cmdExit.Text = "Exit";
			cmdExit.UseVisualStyleBackColor = true;
			ListScenes.AllowDrop = true;
			ListScenes.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			ListScenes.BackColor = System.Drawing.SystemColors.Window;
			ListScenes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[13]
			{
				lvwColHdr1,
				lvwColHdr2,
				lvwColHdr3,
				lvwColHdr4,
				lvwColHdr5,
				lvwColHdr6,
				lvwColHdr7,
				lvwColHdr8,
				lvwColHdr9,
				lvwColHdr10,
				lvwColHdr11,
				lvwColHdr12,
				clmFilename
			});
			ListScenes.Font = new System.Drawing.Font("Segoe UI", 10f);
			ListScenes.ForeColor = System.Drawing.SystemColors.WindowText;
			ListScenes.FullRowSelect = true;
			ListScenes.GridLines = true;
			ListScenes.HideSelection = false;
			ListScenes.Location = new System.Drawing.Point(14, 14);
			ListScenes.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			ListScenes.Name = "ListScenes";
			ListScenes.Size = new System.Drawing.Size(824, 554);
			ListScenes.TabIndex = 0;
			ListScenes.UseCompatibleStateImageBehavior = false;
			ListScenes.View = System.Windows.Forms.View.Details;
			lvwColHdr1.Text = "Ch";
			lvwColHdr1.Width = 112;
			lvwColHdr2.Text = "Status";
			lvwColHdr2.Width = 95;
			lvwColHdr3.Text = "A/R";
			lvwColHdr3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
			lvwColHdr3.Width = 71;
			lvwColHdr4.Text = "Wds";
			lvwColHdr4.Width = 71;
			lvwColHdr5.Text = "D";
			lvwColHdr5.Width = 48;
			lvwColHdr6.Text = "H";
			lvwColHdr6.Width = 48;
			lvwColHdr7.Text = "M";
			lvwColHdr7.Width = 48;
			lvwColHdr8.Text = "VP";
			lvwColHdr8.Width = 106;
			lvwColHdr9.Text = "Description";
			lvwColHdr9.Width = 824;
			lvwColHdr10.Text = "Days";
			lvwColHdr10.Width = 59;
			lvwColHdr11.Text = "Hrs";
			lvwColHdr11.Width = 59;
			lvwColHdr12.Text = "Mins";
			lvwColHdr12.Width = 59;
			clmFilename.Text = "Filename";
			cmdPrint.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			cmdPrint.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdPrint.Location = new System.Drawing.Point(644, 575);
			cmdPrint.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdPrint.Name = "cmdPrint";
			cmdPrint.Size = new System.Drawing.Size(87, 54);
			cmdPrint.TabIndex = 4;
			cmdPrint.Text = "Print";
			cmdPrint.UseVisualStyleBackColor = true;
			StatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				tssStatus
			});
			StatusStrip1.Location = new System.Drawing.Point(0, 642);
			StatusStrip1.Name = "StatusStrip1";
			StatusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 16, 0);
			StatusStrip1.Size = new System.Drawing.Size(850, 28);
			StatusStrip1.TabIndex = 5;
			StatusStrip1.Text = "StatusStrip1";
			tssStatus.Name = "tssStatus";
			tssStatus.Size = new System.Drawing.Size(25, 23);
			tssStatus.Text = "   ";
			base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			BackColor = System.Drawing.SystemColors.Control;
			base.ClientSize = new System.Drawing.Size(850, 670);
			base.Controls.Add(StatusStrip1);
			base.Controls.Add(cmdPrint);
			base.Controls.Add(cmdChangeSelected);
			base.Controls.Add(cmbStatus);
			base.Controls.Add(cmdExit);
			base.Controls.Add(ListScenes);
			Cursor = System.Windows.Forms.Cursors.Default;
			DoubleBuffered = true;
			Font = new System.Drawing.Font("Segoe UI", 10f);
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.Location = new System.Drawing.Point(4, 23);
			base.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			base.Name = "frmSceneList";
			RightToLeft = System.Windows.Forms.RightToLeft.No;
			Text = "Scene List";
			StatusStrip1.ResumeLayout(false);
			StatusStrip1.PerformLayout();
			ResumeLayout(false);
			PerformLayout();
		}

		public frmSceneList(ref clsProject ProjectClass)
		{
			base.Load += frmSceneList_Load;
			base.FormClosing += frmSceneList_FormClosing;
			HighlightedScene = new Rectangle(0, 0, 0, 0);
			InitializeComponent();
			cProject = ProjectClass;
			cProject.AddedNewScene += cProject_AddedNewScene;
			cProject.AddedNewChapter += cProject_AddedNewChapter;
			cProject.SavedScene += cProject_SavedScene;
			cProject.SavedChar += cProject_SavedChar;
		}

		private void cmdChangeSelected_Click(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_00ea, IL_0101, IL_010c, IL_011c, IL_0166, IL_0168, IL_017c, IL_019e
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				int status = cmbStatus.SelectedIndex + 1;
				num2 = 3;
				IEnumerator enumerator = ListScenes.SelectedItems.GetEnumerator();
				while (enumerator.MoveNext())
				{
					ListViewItem listViewItem = (ListViewItem)enumerator.Current;
					num2 = 4;
					if (Operators.CompareString(listViewItem.SubItems["STATUS"].Text, cmbStatus.Text, TextCompare: false) != 0)
					{
						num2 = 5;
						int iD = Conversions.ToInteger(listViewItem.Tag);
						num2 = 6;
						clsScene clsScene = cProject.get_SceneByID(iD);
						num2 = 7;
						clsScene.Status = status;
						num2 = 8;
						listViewItem.SubItems["STATUS"].Text = cmbStatus.Text;
						num2 = 9;
						clsScene.TriggerSaveEvent();
					}
					num2 = 10;
				}
				num2 = 11;
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_019c: Could not find block for branch target IL_0168*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void cmdExit_Click(object eventSender, EventArgs eventArgs)
		{
			Hide();
			cDelay.DoEvents();
		}

		private void frmSceneList_Load(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_0113, IL_012a, IL_0135, IL_0145, IL_0193, IL_0195, IL_01a9, IL_01cb
			int num = default(int);
			int num4 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				base.Icon = Resources.yWriter5_Ico;
				num2 = 3;
				clsSettings cSettings = clsShared.cSettings;
				Form Form = this;
				cSettings.ReadWindowSettings("SceneList", ref Form);
				num2 = 4;
				clsSettings cSettings2 = clsShared.cSettings;
				ListView List = ListScenes;
				cSettings2.ReadColumnSettings("SceneList", ref List);
				ListScenes = List;
				num2 = 5;
				if (Operators.CompareString(clsShared.cLang.CurrentLanguage, "English", TextCompare: false) != 0)
				{
					num2 = 6;
					clsShared.cLang.TranslateForm(this);
				}
				num2 = 7;
				clsShared.cFormFont.SetFormFont(this, clsShared.cSettings.sGet("FormFont", modVariables.DefaultUIFont.Name), clsShared.cSettings.sGet("UIFontSize", modVariables.DefaultUIFont.Size));
				num2 = 8;
				int num3 = modVariables.StatusNames.Length - 1;
				for (int i = 1; i <= num3; i++)
				{
					num2 = 9;
					cmbStatus.Items.Add(clsShared.cLang.GetTranslation(modVariables.StatusNames[i]));
					num2 = 10;
				}
				num2 = 11;
				cmbStatus.SelectedIndex = 0;
				num2 = 12;
				FillList();
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num4 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_01c9: Could not find block for branch target IL_0195*/;
			}
			if (num4 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void frmSceneList_FormClosing(object eventSender, FormClosingEventArgs eventArgs)
		{
			if (eventArgs.CloseReason == CloseReason.UserClosing)
			{
				eventArgs.Cancel = true;
				clsSettings cSettings = clsShared.cSettings;
				ListView List = ListScenes;
				cSettings.StoreColumnSettings("SceneList", ref List);
				ListScenes = List;
				clsShared.cSettings.StoreWindowSettings("SceneList", this);
				ClosedFormEvent?.Invoke();
				Hide();
				cDelay.DoEvents();
			}
		}

		private void ListView1_DoubleClick(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_0047, IL_005d, IL_0067, IL_0074, IL_00a6, IL_00a8, IL_00bc, IL_00de
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				if (ListScenes.FocusedItem != null)
				{
					num2 = 4;
					int scID = Conversions.ToInteger(ListScenes.FocusedItem.Tag);
					num2 = 5;
					EditSceneEvent?.Invoke(scID, 0);
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_00dc: Could not find block for branch target IL_00a8*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		public void FillList()
		{
			//Discarded unreachable code: IL_01e0, IL_01f7, IL_0202, IL_0212, IL_0290, IL_0292, IL_02a6, IL_02c8
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				string text;
				if (ListScenes.FocusedItem != null)
				{
					num2 = 3;
					text = Conversions.ToString(ListScenes.FocusedItem.Tag);
				}
				else
				{
					num2 = 5;
					text = "";
				}
				num2 = 6;
				ListScenes.BeginUpdate();
				num2 = 7;
				ListScenes.Items.Clear();
				num2 = 8;
				IEnumerator enumerator = cProject.AllChapters().GetEnumerator();
				while (enumerator.MoveNext())
				{
					clsChapter clsChapter = (clsChapter)enumerator.Current;
					num2 = 9;
					int sceneCount = clsChapter.SceneCount;
					for (int i = 1; i <= sceneCount; i++)
					{
						num2 = 10;
						clsScene clsScene = cProject.get_SceneByChID(clsChapter.ID, i);
						num2 = 11;
						ListViewItem Item = ListScenes.Items.Add(Conversions.ToString(clsScene.ID), "", "");
						num2 = 12;
						SceneToItem(ref Item, clsScene);
						num2 = 13;
					}
					num2 = 14;
				}
				num2 = 15;
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
				num2 = 16;
				if (ListScenes.Items.Count > 0)
				{
					num2 = 17;
					if (!ListScenes.Items.ContainsKey(text))
					{
						num2 = 18;
						text = "";
					}
					num2 = 19;
					ListScenes.Items[0].Selected = false;
					num2 = 20;
					if (Operators.CompareString(text, "", TextCompare: false) != 0)
					{
						num2 = 21;
						ListScenes.FocusedItem = ListScenes.Items[text];
						num2 = 22;
						ListScenes.EnsureVisible(ListScenes.Items.Count - 1);
						num2 = 23;
						ListScenes.FocusedItem.EnsureVisible();
					}
				}
				num2 = 24;
				ListScenes.EndUpdate();
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_02c6: Could not find block for branch target IL_0292*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		public void UpdateItem(int ScID)
		{
			//Discarded unreachable code: IL_003d, IL_0053, IL_005d, IL_006a, IL_0098, IL_009a, IL_00ae, IL_00d0
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				ListViewItem Item = ListScenes.Items[Conversions.ToString(ScID)];
				num2 = 3;
				if (Item != null)
				{
					num2 = 4;
					SceneToItem(ref Item, cProject.get_SceneByID(ScID));
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_00ce: Could not find block for branch target IL_009a*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void SceneToItem(ref ListViewItem Item, clsScene cScene)
		{
			//Discarded unreachable code: IL_0351, IL_0368, IL_0373, IL_0383, IL_0431, IL_0433, IL_0447, IL_0469
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				clsCharacter clsCharacter = cProject.get_CharByID(cScene.ViewPointID);
				num2 = 3;
				Item.Text = cProject.get_ChapterByID(cScene.BelongsToChID).Title;
				while (true)
				{
					num2 = 5;
					if (Item.SubItems.Count >= ListScenes.Columns.Count)
					{
						break;
					}
					num2 = 6;
					Item.SubItems.Add("");
				}
				num2 = 8;
				Item.SubItems[1].Text = clsShared.cLang.GetTranslation(modVariables.StatusNames[cScene.Status]);
				num2 = 9;
				Item.SubItems[1].ForeColor = modVariables.StatusColours[cScene.Status];
				num2 = 10;
				Item.SubItems[1].Name = "STATUS";
				num2 = 11;
				if (cScene.ReactionScene)
				{
					num2 = 12;
					Item.SubItems[2].Text = "R";
				}
				else
				{
					num2 = 14;
					Item.SubItems[2].Text = "A";
				}
				num2 = 15;
				Item.SubItems[3].Text = Conversions.ToString(cScene.Wordcount);
				num2 = 16;
				if (cScene.SpecificDateMode)
				{
					num2 = 17;
					Item.SubItems[4].Text = Conversions.ToString(cScene.SpecificDateTime.Date);
					num2 = 18;
					Item.SubItems[5].Text = Strings.Format(cScene.SpecificDateTime, "HH:mm");
					num2 = 19;
					Item.SubItems[6].Text = "";
				}
				else
				{
					num2 = 21;
					Item.SubItems[4].Text = Conversions.ToString(cScene.Day_Renamed);
					num2 = 22;
					Item.SubItems[5].Text = Conversions.ToString(cScene.Hour_Renamed);
					num2 = 23;
					Item.SubItems[6].Text = Conversions.ToString(cScene.Minute_Renamed);
				}
				num2 = 24;
				Item.SubItems[7].Text = clsCharacter.Title;
				num2 = 25;
				Item.SubItems[7].Name = "VPTITLE";
				num2 = 26;
				Item.SubItems[8].Text = cScene.Title;
				num2 = 27;
				if (cScene.Unused)
				{
					num2 = 28;
					Item.SubItems[8].ForeColor = cColours.GreyInk;
				}
				else
				{
					num2 = 30;
					Item.SubItems[8].ForeColor = SystemColors.WindowText;
				}
				num2 = 31;
				Item.SubItems[9].Text = Conversions.ToString(cScene.LastsDays);
				num2 = 32;
				Item.SubItems[10].Text = Conversions.ToString(cScene.LastsHours);
				num2 = 33;
				Item.SubItems[11].Text = Conversions.ToString(cScene.LastsMinutes);
				num2 = 34;
				if (!cProject.V6File)
				{
					num2 = 35;
					Item.SubItems[12].Text = clsShared.cFile.FileOnly(cScene.RTFFilename);
				}
				num2 = 36;
				Item.Tag = Conversions.ToString(cScene.ID);
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_0467: Could not find block for branch target IL_0433*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void cProject_SavedScene(int ID)
		{
			UpdateItem(ID);
		}

		private void cProject_SavedChar(int ID)
		{
			//Discarded unreachable code: IL_00c5, IL_00dc, IL_00e7, IL_00f7, IL_0141, IL_0143, IL_0157, IL_0179
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				ListScenes.BeginUpdate();
				num2 = 3;
				string title = cProject.get_CharByID(ID).Title;
				num2 = 4;
				IEnumerator enumerator = ListScenes.Items.GetEnumerator();
				while (enumerator.MoveNext())
				{
					ListViewItem listViewItem = (ListViewItem)enumerator.Current;
					num2 = 5;
					int iD = Conversions.ToInteger(listViewItem.Tag);
					num2 = 6;
					int viewPointID = cProject.get_SceneByID(iD).ViewPointID;
					num2 = 7;
					if (viewPointID == ID)
					{
						num2 = 8;
						listViewItem.SubItems["VPTITLE"].Text = title;
					}
					num2 = 9;
				}
				num2 = 10;
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
				num2 = 11;
				ListScenes.EndUpdate();
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_0177: Could not find block for branch target IL_0143*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void cProject_AddedNewChapter(int ID)
		{
			FillList();
		}

		private void cProject_AddedNewScene(int ID)
		{
			FillList();
		}

		private void cmdPrint_Click(object sender, EventArgs e)
		{
			clsShared.cSubs.BusyBGmouse();
			try
			{
				tssStatus.Text = "";
				clsReport clsReport = new clsReport(ref clsShared.cLog, ref clsShared.cSettings, "Scene List");
				clsReport.AddTitle();
				clsReport.AddCentered(cProject.Title + " by " + cProject.AuthorName);
				clsReport.AddBR(2);
				clsReport.SetTableBorder(1);
				clsReport.SetTablePercentWidth(100);
				clsReport.OpenTable("cellpadding=5");
				clsReport.OpenRow();
				int num = ListScenes.Columns.Count - 1;
				for (int i = 0; i <= num; i++)
				{
					clsReport.AddCell("<b>" + ListScenes.Columns[i].Text + "</b>", clsReport.Class_Header);
				}
				clsReport.CloseRow();
				int num2 = 0;
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = ListScenes.Items.GetEnumerator();
					while (enumerator.MoveNext())
					{
						ListViewItem listViewItem = (ListViewItem)enumerator.Current;
						num2++;
						tssStatus.Text = "Printing scene " + Conversions.ToString(num2);
						clsReport.OpenRow();
						int num3 = listViewItem.SubItems.Count - 1;
						for (int i = 0; i <= num3; i++)
						{
							clsReport.AddCell(listViewItem.SubItems[i].Text);
						}
						clsReport.CloseRow();
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
				clsReport.CloseTable();
				clsReport.AddFooter(App.Title);
				clsReport.Show();
				tssStatus.Text = "Printing Complete";
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
			clsShared.cSubs.NormalMouse();
		}

		private void ListScenes_DragDrop(object sender, DragEventArgs e)
		{
			try
			{
				if (HighlightedScene != Rectangle.Empty)
				{
					ListScenes.Invalidate(HighlightedScene);
				}
				if (DraggingScenes && e.Effect == DragDropEffects.Move)
				{
					DraggingScenes = false;
					string[] array = (string[])e.Data.GetData(DataFormats.StringFormat);
					if (array.Length != 0)
					{
						Point point = ListScenes.PointToClient(new Point(e.X, e.Y));
						ListViewItem itemAt = ListScenes.GetItemAt(point.X, point.Y);
						if (itemAt == null)
						{
							e.Effect = DragDropEffects.None;
						}
						else
						{
							int num = Conversions.ToInteger(itemAt.Tag);
							cProject.get_SceneByID(num).MarkUpdated(DateAndTime.Now);
							int belongsToChID = cProject.get_SceneByID(num).BelongsToChID;
							if (num > 0)
							{
								int num2 = array.Length - 1;
								int belongsToChID2 = default(int);
								for (int i = 0; i <= num2; i++)
								{
									int num3 = Conversions.ToInteger(array[i]);
									belongsToChID2 = cProject.get_SceneByID(num3).BelongsToChID;
									cProject.get_ChapterByID(belongsToChID2).RemoveSceneByID(num3);
									cProject.get_ChapterByID(belongsToChID).InsertSceneBeforeID(num3, num);
									cProject.get_SceneByID(num3).MarkUpdated(DateAndTime.Now);
								}
								cProject.get_ChapterByID(belongsToChID).Save();
								cProject.get_ChapterByID(belongsToChID2).Save();
								ListScenes.FocusedItem = ListScenes.TopItem;
								FillList();
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void ListScenes_DragLeave(object sender, EventArgs e)
		{
			try
			{
				if (HighlightedScene != Rectangle.Empty)
				{
					ListScenes.Invalidate(HighlightedScene);
				}
				DraggingScenes = false;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void ListScenes_DragOver(object sender, DragEventArgs e)
		{
			if (!DraggingScenes)
			{
				e.Effect = DragDropEffects.None;
				return;
			}
			e.Effect = DragDropEffects.Move;
			if (e.Data.GetDataPresent(DataFormats.StringFormat, autoConvert: false))
			{
				clsListItemHighlight clsListItemHighlight = new clsListItemHighlight();
				e.Effect = DragDropEffects.Move;
				ListView TargetList = ListScenes;
				clsListItemHighlight.HighlightTarget(e, ref TargetList, ref HighlightedScene);
				ListScenes = TargetList;
			}
		}

		private void ListScenes_ItemDrag(object sender, ItemDragEventArgs e)
		{
			if (cProject.AnyScenesLocked())
			{
				Interaction.MsgBox("You can't move scenes around unless all editor windows are closed (including external)");
			}
		}

		private void DragStart(DragDropEffects Effect = DragDropEffects.Move)
		{
			try
			{
				string[] array = new string[ListScenes.SelectedItems.Count - 1 + 1];
				int num = 0;
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = ListScenes.SelectedItems.GetEnumerator();
					while (enumerator.MoveNext())
					{
						ListViewItem listViewItem = (ListViewItem)enumerator.Current;
						array[num] = Conversions.ToString(listViewItem.Tag);
						num++;
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
				DoDragDrop(new DataObject(DataFormats.StringFormat, array), Effect);
				DraggingScenes = true;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void ListScenes_SelectedIndexChanged(object sender, EventArgs e)
		{
		}
	}
}
